package com.zty.xiaomiadmin.server.Dao;

import com.zty.xiaomiadmin.server.Entity.Tribunal.Tribunal;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface TribunalMapper {

    @Select("select tribunal_id, user_name,store_id,good_id,user_vote,store_vote,result" +
            ",status, orderNo,tribunal_describe from tribunal where tribunal_id = #{tribunal_id}")
    Tribunal getTribunalDetailById(int tribunal_id);


    @Select("select tribunal_id, user_name,store_id,good_id,user_vote,store_vote,result" +
            ",status, orderNo,tribunal_describe,create_time from tribunal where store_id = #{store_id} limit #{pageIndex}, #{pageSize}")
    List<Tribunal> getMyTribunalByStoreId(int store_id, int pageIndex, int pageSize);

    @Select("select count(tribunal_id) from tribunal where store_id = #{store_id}")
    int getMyTribunalByStoreIdNum(int store_id);

    @Select("select * from  tribunal")
    List<Tribunal> getAllTribunal();
}
